import { Controller, Get, Post, Body, Patch, Param, Delete,} from '@nestjs/common';
import { DeploymentUnitService } from './deployment-unit.service';

@Controller('/deploymentUnit')
export class DeploymentUnitController {
  constructor(private readonly deploymentUnitService: DeploymentUnitService) {}

  // 分页查询
  @Post("/pageList")
  pageList(@Body() body: any) {
    return this.deploymentUnitService.pageList(body);
  }

  // 条件查询
  @Post("/queryList")
  queryList(@Body() body: any) {
    return this.deploymentUnitService.queryList(body);
  }

  // 停止运行部署物
  @Post("/issueStop")
  issueStop(@Body() body: any) {
    return this.deploymentUnitService.issueStop(body);
  }

  // 停止运行部署物日志
  @Post("/issueStopLog")
  issueStopLog(@Body() body: any) {
    return this.deploymentUnitService.issueStopLog(body);
  }

  // 一键部署
  @Post("/issueDownload")
  issueDownload(@Body() body: any) {
    return this.deploymentUnitService.issueDownload(body);
  }

  //删除部署物相关节点
  @Post("/issueDelete")
  delete(@Body() body: any) {
    return this.deploymentUnitService.delete(body);
  }

  // 删除部署物文件
  @Post("/deleteList")
  deleteList(@Body() body: any) {
    return this.deploymentUnitService.deleteList(body);
  }

  // 获取所有部署数量
  @Post("/getDeployCount")
  getAllDeploymentCount() {
    return this.deploymentUnitService.getAllDeploymentCount();
  }
}
